package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id获取对应套餐id
     * @param ids
     * @return
     */
    List<Long> getMealByDishId(List<Long> ids);

    /**
     *批量插入菜品套餐关系
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);
    @Delete( "delete  from  setmeal_dish where setmeal_id = #{setmealId}" )
    void deleteBySetmealId(Long setmealId);

    /**
     * 根据套餐ID获取菜品
     * @param id
     * @return
     */
    List<SetmealDish> getDishBySetmealId(Long id);
}
